import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ContentReviewVO, ContentReviewForm, ContentReviewQuery } from '@/api/business/contentReview/types';

/**
 * 查询统一内容审核记录列表
 * @param query
 * @returns {*}
 */

export const listContentReview = (query?: ContentReviewQuery): AxiosPromise<ContentReviewVO[]> => {
  return request({
    url: '/business/contentReview/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询统一内容审核记录详细
 * @param id
 */
export const getContentReview = (id: string | number): AxiosPromise<ContentReviewVO> => {
  return request({
    url: '/business/contentReview/' + id,
    method: 'get'
  });
};

/**
 * 新增统一内容审核记录
 * @param data
 */
export const addContentReview = (data: ContentReviewForm) => {
  return request({
    url: '/business/contentReview',
    method: 'post',
    data: data
  });
};

/**
 * 修改统一内容审核记录
 * @param data
 */
export const updateContentReview = (data: ContentReviewForm) => {
  return request({
    url: '/business/contentReview',
    method: 'put',
    data: data
  });
};

/**
 * 删除统一内容审核记录
 * @param id
 */
export const delContentReview = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/contentReview/' + id,
    method: 'delete'
  });
};
